import {useParams,NavLink,useNavigate} from 'react-router-dom'
function ProduceView() {
  // 获取路径参数
  const params = useParams();
  const navigate = useNavigate();
   console.log(params,"params")
  return ( <div>
    <h3>产品页面-{params.id}</h3>
    <NavLink to="/user" replace>用户</NavLink>
    <button onClick={()=>{navigate("/user",{replace:true,state:{from:"产品"}})}}>用户</button>
  </div> );
}

export default ProduceView;